<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>测试学生接口</title>
    <script>
        function sendRequest() {
            fetch('http://127.0.0.1:8000/student/insert', {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json'
                },
                body: JSON.stringify({
                    first_name: "张",
                    last_name: "三",
                    gender: "male",
                    birthday: "2000-01-01",
                    email: "zhangsan@example.com",
                    phone_number: "1234567890",
                    address: "中国北京市",
                    city: "北京",
                    state: "北京",
                    major: "计算机科学",
                    gpa: 3.5
                })
            })
                .then(response => response.json())
                .then(data => console.log(data))
                .catch(error => console.error('Error:', error));
        }
    </script>
</head>
<body>
<h1>测试学生接口</h1>
<button onclick="sendRequest()">发送请求</button>
</body>
</html>
